Copyright: Copyright © 1995 Strange Solutions Software
Citation: Tony Invencio


Contact & Tech Support

Antonio Invencio

Strange Solutions Software

49 Mill St, Suite 2

Randolph, Ma 02368

USA

Technical Support

Technical Support is handled via E-Mail and is available only to registered users.

Please be as specific as possible, I'll answer any questions you have within 24 hours.

Compuserve	102123,3343

America OnLine	MoBound

Internet	102123.3343@Compuserve.Com

Registration


Contents

INI Aware Components for Delphi

by Strange Solutions Software

Contents

Overview & Components

Palette Installation

Help File Integration

Contact & Tech Support

Registering IACs

© Copyright 1995 Strange Solutions Software


Default Install Dir
Default Install Directory

The Default install Directory is C:\IACS


EaseSection Method
EraseSection Method

Applies to

TIASource

Declaration

Procedure EraseSection(Const Section:String);

Description

The EraseSection method erases an entire section of an .INI file. The Section constant identifies the section of the .INI file to erase. For example, the WIN.INI for Windows contains a [Desktop] section.


EditorEnabled Property

Applies to

TIAEditCombo

Declaration

Property EditorEnabled:Boolean;

Description

The EditorEnabled property controls the editor portion of the TIAEditCombo. If this property is False the user can use the button but not type into the edit area.


Execute Method

Applies to

TIASaveDialog, TIAOpenDialog

Declaration

Function Execute:Boolean;

Description

The Execute method is used to get a filename using a standard windows dialog box. You can set various aspects of the dialog box via the Options property. If the KeepHistory property is True and the dialog closes successfully the Filename will be added to the HistoryList.


FileName Property

Applies to

TIASource

Declaration

Property FileName:String;

Description

The FileName property is the fully qualified name of the INI file. Delphi looks for the specified .INI file in the Windows directory unless you include a path in the file name. Use the UseAppDir method to automatically attach the application directory to the filename property at runtime.


FireEventFirst Property
ActionAfterEvent Property

Applies to

TIASRButton,TIASRBitBtn, TIASRSpeedButton

Declaration

Property ActionAfterEvent:Boolean;

Description

If the ActionAfterEvent is True when the button is pressed the OnClick event will be called first then the appropriate update method for the INISource will be called. If it's false then the appropriate update method will be called first.


Help File Integration

Palette Installation

Integrating IACs help into Delphi is easy! Follow the steps below. Note, you must first move IACS.HLP to your \Delphi\Bin directory and IACS.KWF to your \Delphi\Help directory.

1. Shut down Delphi.

2. Start the 'Help Installer' program, its in your \Delphi\Help directory.

3. File|Open '\Delphi\Bin\Delphi.hdx'

4. File|Add '\Delphi\Help\IACS.KWF'

5. File|Save

6. Quit the Help Installer


IACs
IACs Defined

INI Aware Components


IACs Components

TIASource

TIAEdit

TIAMaskEdit

TIASpinEdit

TIAEditCombo

TIALabel

TIACheckBox

TIARadioGroup

TIARadioButton

TIAListBox

TIAComboBox

TIAScrollBar

TIADBComboBox

TIAOpenDialog

TIASaveDialog

TIASRBitBtn

TIASRButton

TIASRSpeedButton


INI Entry Dissection


INIItem
INIItem Property

Applies to

All IACs Components (Except the buttons)

Declaration

Property INIItem:String;

Description

The INIItem property relates to an item in an INI file.


INISaveHistory
INISaveHistory Property

Applies to

TIAComboBox

Declaration

Property INISaveHistory:Boolean;

Description

The INISaveHistory property indicates whether or not to save the Items in the list part of the TIAComboBox. If this property is True when the WriteINI/ReadINI method is called the strings will be written/read from/to the INI file. .


INISaveItems
INISaveItems Property

Applies to

TIAListBox

Declaration

Property INISaveItems:Boolean;

Description

The INISaveItems indicates whether or not the items of the listbox will be saved and read from the ini file when the WriteINI and ReadINI methods are called.


INISection
INISection Property

Applies to

All IACs Components (Except the Buttons)

Declaration

Property INISection:String;

Description

The INISection property is the section from which the values will come from in the INI file.


INISource
INISource Property

Applies to

All IACs Components

Declaration

Property INISource:TIASource;

Description

The source property connects the component with a TIASource component.


Installation
Installing IACs onto the Delphi Palette

Help File Integration

The following instructions assumes a default installation by they setup program.

From Delphi:

1. Options|Install Components

2. Press 'Install' Button

3. Press 'Browse' Button

4. Navigate to the IACs directory.

5. Select IACSREG.PAS

6. Press OK

7. Press OK again.

When Delphi is done there will be a new page added to your palette, with all the IACs. The source to the register unit is included so that you may customize the installation of the components.


KeepHistory Property

Applies to

TIAComboBox

Declaration

Property KeepHistory:Boolean;

Description

When KeepHistory is True the style of the combobox becomes csDropDownList and text entered into the edit area will be placed in the list, automatically when exiting the component.

The component first looks for the Text in the list and if it doesn't find a match the text is inserted.

 Note: The Search is NOT case sensitive.


New Button Properties
New Properties

ActionAfterEvent

SaveButton

INISource


New Dialog Properties
New Properties

INISection

INISource

KeepHistory

SaveLastDir

SaveHistory


New Methods

ReadINI

WriteINI


New Properties

INIItem

INISection

INISource


New TIAComboBox Properties
New Properties

INIItem

INISaveHistory

INISection

INISource

KeepHistory


New TIAListBox Properties
New Properties

INIItem

INISaveItems

INISection

INISource


OSD KeepHistory Property
KeepHistory Property

Applies to

TIASaveDialog, TIAOpenDialog

Declaration

Property KeepHistory:Boolean;

Description

The KeepHistory property allows you to keep track of all the files returned by the dialog box. When you set this to True the EditStyle property will be changed to esComboBox. If a call to Execute returns successfully the name of the file is placed in the HistoryList Property automatically.


OnButtonPress Event

Example

Applies to

TIAEditCombo

Declaration

Property OnButtonPress:TNotifyEvent;

Description

The OnButtonPress event happens when a user presses the button of an TIAEditCombo or presses Ctrl+Return. In this eventhandler you can do anything you need to get a value for the component.


OnButtonPress Example

procedure TForm1.IAEditCombo1ButtonPress(Sender:TObject);

begin

  If IAOpenDialog1.Execute then

    IAEditCombo1.Text:=IAOpenDialog1.FileName;

end;


Overview of components
Overview of IACs

Components

These components provide easy access to an INI file entry via 3 new properties. The standard components require a INISource, INISection, and INIItem . Components such as the buttons only require a source and the Dialog components require both a source and a section.

Each of the Ini Aware Components (IACs) is a direct descendant from a Delphi VCL Component. This is to ensure maximum compatibility with existing code. You can replace a standard TEdit with a TIAEdit and have an instant connection to an INI file without any problems.

IACs grew out of a need for an easy way to save and restore values from session to session. The TINIFile object was good but having to write the same code over and over got tiresome. Now with IACs, all you have to do is place an IACs component and a TIASource down on your form, and you can easily keep track of values. Click on "Components" above to Get a list of all IACs components.


ReadBool Method

Applies to

TIASource

Declaration

Function ReadBool(Const Section, Item:String; Default:Boolean):Boolean;

Description

The ReadBool is just like the ReadBool Method of the TIniFile object. In fact the name has been kept the same to ensure compatibility. This method reads a Boolean value from an INI file.

If no value is found in the file the default is returned.


ReadINI
ReadINI Method

Applies to

All IACs Components (except the buttons)

Declaration

Procedure ReadINI;

Description

The ReadINI Method reads the information from the INI file into the component. If any of the required properties are missing, such as INIItem, INISection, or INISource nothing will happen.


ReadInteger Method

Applies to

TIASource

Declaration

Function ReadInteger(Const Section, Item:String; Default:Integer):Integer;

Description

The ReadInteger is just like the ReadInteger Method of the TIniFile object. In fact the name has been kept the same to ensure compatibility. This method reads a Integer value from an INI file.

If no value is found in the file the default is returned.


ReadList Method

Applies to

TIASource

Declaration

Procedure ReadList(Const Section, Item:String; StrList:TStrings);

Description

The ReadList Method is a procedure that reads a list of values from an INI file. INISection is the name of the Section that the Items reside in. The Item parameter is used to keep  a count of Items written and the actual items. StrList gets cleared and will receive the values from the INI file.

If there are no values found StrList will be returned empty.

This reads in the output of the WriteList Method which is:

[MainForm]

FruiteListCount=3

FruiteList0=Apples

FruiteList1=Oranges

FruiteList2=Pears

Also See

WriteList


ReadSection Method

Applies to

TIASource

Declaration

Procedure ReadSection(Const Section:String; Strings:TStrings);

Description

The ReadSection is just like the ReadSection Method of the TIniFile object. In fact the name has been kept the same to ensure compatibility. This method reads a whole Section from an INI file and places it in a TStrings object.


ReadSectionValues Methods
ReadSectionValues  Method

Applies to

TIASource

Declaration

Procedure ReadSectionValues(Const Section:String; Strings:TStrings);

Description

The ReadSectionValues is just like the ReadSectionValues Method of the TIniFile object. In fact the name has been kept the same to ensure compatibility. This method reads a whole Section of values from an INI file.


ReadString Method

Applies to

TIASource

Declaration

Function ReadString(Const Section, Item, Default:String):String;

Description

The ReadString is just like the ReadString Method of the TIniFile object. In fact the name has been kept the same to ensure compatibility. This method reads a String value from an INI file.

If no value is found in the file the default is returned.


Registering IACS

When you register you will receive unlimited tech support via E-Mail and a new package with out any restrictions. All minor upgrades are free and the Delphi32 upgrade will be free too.

You can register via Compuserve SWREG use the following numbers:

# 8605 = IACs for Delphi v1.1 for $49.00

# 9325 = IACs for Delphi v1.1 w/Source for $98.00

You can also send Check or Money Order to the Address below.

If you have any questions or comments. I'd be very interested in knowing what you think of IACs. Please drop me a line at any one of the following:

Antonio Invencio

49 Mill St, Suite 2

Randolph, Ma 02368

USA

Compuserve: 102123,3343

America OnLine: MoBound

Internet: 102123.3343@compuserve.com


SaveButton Property

Applies to

TIASRBitBtn, TIASRButton, TIASRSpeedButton

Declaration

Property SaveButton:Boolean;

Description

The SaveButton property determines what action will take place when the button is pressed. If the property is True the UpdateFile method of INISource is called. If its false the UpdateControls method is called.


SaveHistory Property

Applies to

TIASaveDialog, TIAOpenDialog

Declaration

Property SaveHistory:Boolean;

Description

The SaveHistory Property determines whether or not the HistoryList is written to and read from the INI file when the component's ReadINI or WriteINI method is called.


SaveItems Property

Applies to

TIAComboBox

Declaration

Property SaveItems:Boolean;

Description

The SaveItems property determines  if the Items stringlist will be written to or read from the INI file.


SaveLastDir Property

Applies to

TIASaveDialog, TIAOpenDialog

Declaration

Property SaveLastDir:Boolean;

Description

If SaveLastDir is True when the ReadINI method for the dialog is called,the component will read the last directory from the INI file and set it as the InitialDir for the dialog. If its True when the WriteINI method is called the component will get the directory name from the FileName property and write it to the INI file.


TIACheckBox
 TIACheckBox Component

New Properties	New Methods	TCheckBox

Unit

IACS

Description

The TIACheckBox is a direct descendant of TCheckBox component. All the properties, methods, and events of TCheckBox are available in addition to 2 new methods and 3 new properties.

The INISource property connects this component to a TIASource component. The INISection and INIItem properties pertain to the INI file Entry

You can get/set the value in the INI file associated with this component with the ReadINI and WriteINI methods.

Note: The Text property is used as the default value when reading from the INI file.


TIAComboBox
 TIAComboBox Component

New Properties	New Methods	TComboBox

Unit

IACS

Description

The TIAComboBox is a direct descendant of TComboBox component. All the properties, methods, and events of TComboBox are available in addition to 2 new methods and 3 new properties.

The INISource property connects this component to a TIASource component. The INISection and INIItem properties pertain to the INI file Entry

You can get/set the value in the INI file associated with this component with the ReadINI and WriteINI methods.

Note: The Text and ItemIndex properties are used as the default values when reading from the INI file.

This component reads and writes from/to the ItemIndex, Count, Text, and Items property.


TIADBComboBox
 TIADBComboBox Component

New Properties	New Methods	TDBComboBox

Unit

IACS

Description

The TIADBComboBox is a direct descendant of TDBComboBox component. All the properties, methods, and events of TComboBox are available in addition to 2 new methods and 3 new properties.

The INISource property connects this component to a TIASource component. The INISection and INIItem properties pertain to the INI file Entry

You can get/set the values in the INI file associated with this component with the ReadINI and WriteINI methods.

Since this component is also connected to a database , the value for this component is gotten from the database connection, only the list items are saved and retreived from the INI file.


TIAEdit
 TIAEdit Component

New Properties	New Methods	TEdit

Unit

IACS

Description

The TIAEdit is a direct descendant of TEdit component. All the properties, methods, and events of TEdit are available in addition to 2 new methods and 3 new properties.

The INISource property connects this component to a TIASource component. The INISection and INIItem properties pertain to the INI file Entry

You can get/set the value in the INI file associated with this component with the ReadINI and WriteINI methods.

Note: The Text property is used as the default value when reading from the INI file.


TIAEditCombo
 TIAEditCombo Component

Properties	Events

Unit

IACS

Description

The TIAEditCombo is an editbox with a button neatly attached to it. When a user presses the button a OnButtonPress event is fired. As with all IACs components the INISource property will allow you to connect this component to a TIASource. The INISection and INIItem properties connect the component to an entry in an INI file.

You can get/set the value in the INI file associated with this component with the ReadINI and WriteINI methods.

Note: The Text property is used as the default value when reading from the INI file.


TIAEditCombo Events
Events

OnButtonPress

OnChange

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyUp

OnMouseDown

OnMouseUp

OnMouseMove


TIAEditCombo Properties
Properties

AutoSelect	ParentCtl3D

AutoSize	ParentFont

Color	ParentShowHint

Ctl3D	PopUpMenu

DragCursor	ReadOnly

DragMode	INISection

EditorEnabled	ShowHint

Enabled	INISource

Font	TabOrder

Height	TabStop

HelpContext	Tag

Hint	Text

INIItem	Top

Left	Visible

MaxLength	Width

Name

ParentColor


TIALabel
 TIALabel Component

New Properties	New Methods	TLabel

Unit

IACS

Description

The TIALabel is a direct descendant of TLabel component. All the properties, methods, and events of TLabel are available in addition to 2 new methods and 3 new properties.

The INISource property connects this component to a TIASource component. The INISection and INIItem properties pertain to the INI file Entry

You can get/set the value in the INI file associated with this component with the ReadINI and WriteINI methods.

Note: The Caption property is used as the default value when reading from the INI file.


TIAListBox
 TIAListBox Component

New Properties	New Methods	TListBox

Unit

IACS

Description

The TIAListBox is a direct descendant of TListBox component. All the properties, methods, and events of TListBox are available in addition to 2 new methods and 4 new properties.

The INISource property connects this component to a TIASource component. The INISection and INIItem properties pertain to the INI file Entry The INISaveItems property indicates wether the listbox items will be saved or read when the ReadINI or WriteINI methods are called.

You can get/set the value in the INI file associated with this component with the ReadINI and WriteINI methods.

Note: The Text property is used as the default value when reading from the INI file.


TIAMaskEdit
 TIAMaskEdit Component

New Properties	New Methods	TMaskEdit

Unit

IACS

Description

The TIAMaskEdit is a direct descendant of TMaskEdit component. All the properties, methods, and events of TMaskEdit are available in addition to 2 new methods and 3 new properties.

The INISource property connects this component to a TIASource component. The INISection and INIItem properties pertain to the INI file Entry

The TIAMaskEdit component reads and writes the Value property. You can get/set the value in the INI file associated with this component with the ReadINI and WriteINI methods.

Note: The Text property is used as the default value when reading from the INI file.


TIAOpenDialog
  TIAOpenDialog Component

New Properties	TOpenDialog

Unit

IADialgs

Description

The TIAOpenDialog component is a direct descendant of TOpenDialog component. All the properties, methods, and events of TOpenDialog are available in addition to 5 new properties.

The INISource property connects this component to a TIASource component. The INISection property is a section in a INI file, where the values will be kept. If KeepHistory is true the FileEditStyle property will be fsComboBox and each time the execute method returns successfully the Filename will be placed in the HistoryList.

If SaveHistory is True the HistoryList will be written to and read from the INI file. If SaveLastDir is True the directory name from the last successful file will be saved to the INI file and used as the InitialDir next time this component is created.


TIARadioButton
  TIARadioButton Component

New Properties	New Methods	TRadioButton

Unit

IACS

Description

The TIARadioButton is a direct descendant of TRadioButton component. All the properties, methods, and events of TRadioButton are available in addition to 2 new methods and 3 new properties.

The INISource property connects this component to a TIASource component. The INISection and INIItem properties pertain to the INI file Entry

You can get/set the value in the INI file associated with this component with the ReadINI and WriteINI methods.

Note: The Checked property is used as the default value when reading from the INI file.


TIARadioGroup
 TIARadioGroup Component

New Properties	New Methods	TRadioGroup

Unit

IACS

Description

The TIARadioGroup is a direct descendant of TRadioGroup component. All the properties, methods, and events of TRadioGroup are available in addition to 2 new methods and 3 new properties.

The INISource property connects this component to a TIASource component. The INISection and INIItem properties pertain to the INI file Entry

You can get/set the value in the INI file associated with this component with the ReadINI and WriteINI methods.

Note: The ItemIndex property is used as the default value when reading from the INI file.


TIASRBitBtn
 TIASRBitBtn Component

New  Properties	TBitBtn

Unit

IACS

Description

The TIASRBitBtn is a direct descendant of TBitBtn component. All the properties, methods, and events of TListBox are available in addition to  3 new properties.

The INISource property connects this component to a TIASource component. The SaveButton property determines what action takes place when the button is pressed. The ActionAfterEvent property determines when the action takes place.


TIASRButton
 TIASRButton Component

New  Properties	TButton

Unit

IACS

Description

The TIASRBitBtn is a direct descendant of TBitBtn component. All the properties, methods, and events of TListBox are available in addition to  3 new properties.

The INISource property connects this component to a TIASource component. The SaveButton property determines what action takes place when the button is pressed. The ActionAfterEvent property determines when the action takes place.


TIASRSpeedButton
 TIASRSpeedButton Component

New  Properties	TSpeedButton

Unit

IACS

Description

The TIASRBitBtn is a direct descendant of TBitBtn component. All the properties, methods, and events of TListBox are available in addition to  3 new properties.

The INISource property connects this component to a TIASource component. The SaveButton property determines what action takes place when the button is pressed. The ActionAfterEvent property determines when the action takes place.


TIASaveDialog
 TIASaveDialog Component

New Properties	TSaveDialog

Unit

IADialgs

Description

The TIASaveDialog component is a direct descendant of TSaveDialog component. All the properties, methods, and events of TSaveDialog are available in addition to 5 new properties.

The INISource property connects this component to a TIASource component. The INISection property is a section in a INI file, where the values will be kept. If KeepHistory is true the FileEditStyle property will be fsComboBox and each time the execute method returns successfully the Filename will be placed in the HistoryList.

If SaveHistory is True the HistoryList will be written and read from the INI file. If SaveLastDir is True the directory name from the last successful file will be saved to the INI file and used as the InitialDir next time this component is created.


TIAScrollBar
 TIAScrollBar Component

New Properties	New Methods	TScrollBar

 Unit

IACS

Description

The TIAScrollBar is a direct descendant of TScrollBar component. All the properties, methods, and events of TScrollBar are available in addition to 2 new methods and 3 new properties.

The INISource property connects this component to a TIASource component. The INISection and INIItem properties pertain to the INI file Entry

The TIAScrollBar component reads and writes the Position property. You can get/set the value in the INI file with the ReadINI and WriteINI methods.

Note: The Position property is used as the default values when reading from the INI file.


TIASource
 TIASource Component

Properties	Methods

Unit

IAConn

Description

The TIASource component is the centerpiece of the IACs VCL. It connects all the components to the INI file and also give you direct access to the ini file with its methods. Each IACs component has a INISource property that gets connected to one of these. This component can be used just like the TINIFile object that Delphi came with.


TIASource Methods
Methods

EraseSection

ReadBool

ReadInteger

ReadList

ReadSection

ReadSectionValues

ReadString

UpdateControls

UpdateFile

WriteBool

WriteInteger

WriteList

WriteString


TIASource Properties
Properties

FileName

Name

Tag

UseAppDir


TIASpinEdit
TIASpinEdit Component

New Properties	New Methods

Unit

IACS

Description

The TIASpinEdit is a direct descendant of TSpinEdit sample component. All the properties, methods, and events of TSpinEdit are available in addition to 2 new methods and 3 new properties.

The INISource property connects this component to a TIASource component. The INISection and INIItem properties pertain to the INI file Entry

The TIASpinEdit component reads and writes the Value property. You can get/set the value in the INI file associated with this component with the ReadINI and WriteINI methods.

Note: The Value property is used as the default value when reading from the INI file.

This component is a sample and there is no documentation for it. The \Delphi\Source\Samples directory contains the source. Your on your own<g>.


UpdateControls Method

Applies to

TIASource

Declaration

Procedure UpdateControls;

Description

The UpdateControls method calls the ReadINI method for each component that is linked to the TIASource.

Also See

UpdateFile


UpdateFile Method

Applies to

TIASource

Declaration

Procedure UpdateFile;

Description

The UpdateFile method calls the WriteINI method for each component that is linked to the TIASource. If the INISection and INIItem properties are set, then the value will be written to the INI file.

Also See

UpdateControls


UseAppDir
UseAppDir Property

Applies to

TIASource

Declaration

Property UseAppDir:Boolean;

Description

If the UseAppDir property is true the application path will be added to the FileName, at runtime. If a path already exists in the FileName, it will be replaced.


WriteBool Method

Applies to

TIASource

Declaration

Procedure WriteBool(Const Section, Item:String; Value:Boolean);

Description

The WriteBool is just like the WriteBool Method of the TIniFile object. In fact the name has been kept the same to ensure compatibility. This method Writes a Boolean value from an INI file.

Also See

ReadBool


WriteINI
WriteINI Method

Applies to

All IACs Components (Except the Buttons)

Declaration

Procedure WriteINI;

Description

The WriteINI method writes the component value to the INI file. When using UpdateFile method of a TIASource this method is called for each component.


WriteInteger Method

Applies to

TIASource

Declaration

Procedure WriteInteger(Const Section, Item:String; Value:Integer);

Description

The WriteInteger is just like the WriteInteger Method of the TIniFile object. In fact the name has been kept the same to ensure compatibility. This method writes a Integer value to an INI file.

Also See

ReadInteger


WriteList Method

Applies to

TIASource

Declaration

Procedure WriteList(Const Section, Item:String; Strlist:TStrings);

Description

The WriteList Method is a procedure that writes a list of values to an INI file. Section is the name of the Section that the Items reside in. The Item parameter is used to keep a count of Items written and the actual items. StrList gets cleared and will receive the values from the INI file.

Thoutput of the WriteList Method is:

[MainForm]

FruiteListCount=3

FruiteList0=Apples

FruiteList1=Oranges

FruiteList2=Pears

Also See

ReadList


WriteString Method

Applies to

TIASource

Declaration

Procedure WriteString(Const Section, Item, Value:String);

Description

The WriteString is just like the WriteString Method of the TIniFile object. In fact the name has been kept the same to ensure compatibility. This method writes a String value to an INI file.

Also See

ReadString